
#ifndef TOUCH_LISTENER_H
#define TOUCH_LISTENER_H

// INCLUDES ********************************************************************

#include "Vector2D.h"

#include "Logger.h"

// FORWARD DECLARATIONS ********************************************************

// *****************************************************************************

//! TouchListener
//! 
//! Class defining the interface for objects that will respond to touches.
//! Classes that do will have to inherit from this class, implement the methods
//! and register with the global TouchController

// *****************************************************************************

namespace Meteor
{
    class TouchListener
    {
        public:
            virtual void TouchBegan( const Vector2D& position) = 0;
        
            virtual void TouchMoved( const Vector2D& position) = 0;
        
            virtual void TouchEnded( const Vector2D& position,
                                     double duration) = 0;
        
            virtual void SetSwallowsTouches( const bool swallowsTouches)
            {
                mSwallowsTouches = swallowsTouches;
            };
        
            virtual const bool SwallowsTouches() const
            {
                return mSwallowsTouches;
            };
        
            virtual const bool DidSwallowTouch() const
            {
                return mDidSwallowTouch;
            }
    
        protected:
            TouchListener() : mSwallowsTouches( false),
                              mDidSwallowTouch( false)
            {
            };
        
            //! ifs set to true, this object will check if the touch was within
            //! its bounds and if so, block touch delegation to objects beneath 
            //! it
            bool mSwallowsTouches;
        
            //! set to true only if a touch happended within the listeners bounds
            bool mDidSwallowTouch;
    
    }; // end of class TouchListener

} // end of namespace Meteor

#endif
